<?php
ob_start();
ob_implicit_flush(0);

session_start();
ini_set("display_errors", 1); 
error_reporting(E_ALL|E_STRICT);
error_reporting(0);
//error_reporting(1);
defined('ADMIN_BASE_DIR') || define('ADMIN_BASE_DIR', realpath(dirname(__FILE__)));
include ADMIN_BASE_DIR."/config/config.php";
include ADMIN_BASE_DIR."/config/init.php";


if(!check_log_in()) {
    @header("location: ".ADMIN_URL."/login.php");
    exit();
}

if(!check_login_single()) {
	
    @header("location: ".ADMIN_URL."/login.php");
    exit();
}

$module = @$_REQUEST["module"];
$option = @$_REQUEST["option"];
$action = @$_REQUEST["action"];
if(check_permission($_SESSION['adlogin']["id"],$module)==false && !empty($module)){

	echo "<div style='float:left; height:20px; display:inline; margin-left: 280px; margin-top: 10px; font-size:12px; border:3px orange solid; padding:10px;'><font color=red><b>:)) You have not permission to control this modules. Please Contact to administrator to know detail addly...</b></font></div>";
	die();
	//redirect(ADMIN_URL);
}

if($option=='') {
    $option = $action;
}

// Main

switch($module) {
    case 'user': {
            include ADMIN_MODULE_DIR.'/user/functions/user-functions.php';
            include ADMIN_MODULE_DIR.'/user/user_index.php';
            break;
    }case 'member': {
            include ADMIN_MODULE_DIR.'/member/functions/mem-functions.php';
            include ADMIN_MODULE_DIR.'/member/member_index.php';
            break;
    }case 'property': {
            include ADMIN_MODULE_DIR.'/property/functions/property-functions.php';
            include ADMIN_MODULE_DIR.'/property/property_index.php';
            break;
    }case 'news': {
            include ADMIN_MODULE_DIR.'/news/functions/news-functions.php';
            include ADMIN_MODULE_DIR.'/news/news_index.php';
            break;
    }case 'projects': {
            include ADMIN_MODULE_DIR.'/projects/functions/projects-functions.php';
            include ADMIN_MODULE_DIR.'/projects/projects_index.php';
            break;
    }case 'images': {
            include ADMIN_MODULE_DIR.'/images/functions/images-functions.php';
            include ADMIN_MODULE_DIR.'/images/images_index.php';
            break;
    }case 'myaccount': {
            include ADMIN_MODULE_DIR.'/myaccount/functions/account-functions.php';
            include ADMIN_MODULE_DIR.'/myaccount/account_index.php';
            break;
    }case 'faq': {
            include ADMIN_MODULE_DIR.'/faq/functions/faq-functions.php';
            include ADMIN_MODULE_DIR.'/faq/faq_index.php';
            break;
     }case 'intro': {
            include ADMIN_MODULE_DIR.'/intro/functions/intro-functions.php';
            include ADMIN_MODULE_DIR.'/intro/intro_index.php';
            break;
     }case 'document': {
            include ADMIN_MODULE_DIR.'/document/functions/document-functions.php';
            include ADMIN_MODULE_DIR.'/document/document_index.php';
            break;
     }case 'video': {
            include ADMIN_MODULE_DIR.'/video/functions/video-functions.php';
            include ADMIN_MODULE_DIR.'/video/video_index.php';
            break;
     }case 'adv': {
            include ADMIN_MODULE_DIR.'/adv/functions/adv-functions.php';
            include ADMIN_MODULE_DIR.'/adv/adv_index.php';
            break;
    }case 'partner': {
            include ADMIN_MODULE_DIR.'/adv/functions/partner-functions.php';
            include ADMIN_MODULE_DIR.'/adv/partner_index.php';
            break;
 	}case
    'newsletter': {
            include ADMIN_MODULE_DIR.'/member/functions/newsletter-functions.php';
            include ADMIN_MODULE_DIR.'/member/newsletter_index.php';
            break;
    }default: {
            include ADMIN_MODULE_DIR.'/statistic/functions/statistic-functions.php';
            include ADMIN_INCLUDE_DIR."/header.php";
            include ADMIN_MODULE_DIR."/statistic/sta_index.php" ;
            include ADMIN_INCLUDE_DIR."/footer.php";
            break;
        }
}
print_gzipped_page();
?>